package com.d3works.apps.businessproject.service;

import com.d3works.apps.project.db.Project;
import com.d3works.apps.project.db.ProjectTask;
import com.d3works.apps.project.db.TaskTemplate;
import com.d3works.apps.sale.db.SaleOrderLine;
import com.d3works.exception.D3worksException;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

public interface ProductTaskTemplateService {

  /**
   * Convert task template list to project task list. This method is recursive.
   *
   * @param templates List of task template to use for convert.
   * @param project Project to set for each project task.
   * @param parent Parent task
   * @param startDate The start date for tasks.
   * @param qty The number copy of the task.
   * @return List of project task convert.
   */
  List<ProjectTask> convert(
      List<? extends TaskTemplate> templates,
      Project project,
      ProjectTask parent,
      LocalDateTime startDate,
      BigDecimal qty,
      SaleOrderLine saleOrderLine)
      throws D3worksException;
}
